package cn.shopping.core.service;


import cn.shopping.core.bo.UploadInfoWithInputStreamBO;
import cn.shopping.core.dbo.UploadInfoDO;
import cn.shopping.core.dto.UploadBase64DTO;
import org.springframework.web.multipart.MultipartFile;

import java.util.Collection;
import java.util.List;

/**
 * @author liys
 * @date 2018/3/1414:04
 */
public interface UploadService {


    /**
     * 上传文件
     * 返回DO对象,生文件的目录路径:/hyzs/data/${yyyy}/${mm}/${dd}/${hh}/${uuid}.txt
     * @param multipartFile
     * @param details
     * @return
     */
    UploadInfoDO uploadFile(MultipartFile multipartFile, Long userId, String details);

    /**
     * 上传文件(不修改尺寸)
     * @param multipartFile
     * @param userId
     * @param details
     * @return
     */
    UploadInfoDO uploadOriginalFile(MultipartFile multipartFile, Long userId, String details);



    List<UploadInfoDO> uploadFiles(MultipartFile[] multipartFiles, Long userId, String details);

    List<UploadInfoDO> uploadBase64(UploadBase64DTO dto);

    UploadInfoWithInputStreamBO getUploadInfoWithInputStream(Long id, Integer pixel);

    UploadInfoWithInputStreamBO getUploadInfoWithInputStream(Long id);

    List<UploadInfoDO> listUploadInfoByIds(Collection<Long> ids);


    UploadInfoDO getUploadInfo(Long id);

    String pictureAsBase64(Long id);

    UploadInfoDO uploadFileByByte(byte[] bytes, String fileName, Long userId, String details);

    UploadInfoWithInputStreamBO getUploadInfoForMp3WithInputStream(Long id);
}
